#include <func.h>

void* thread_func(void* p)
{
    pthread_exit((void*)3);
}
//设置线程属性
int main()
{
    pthread_t pthid;
    pthread_attr_t attr;
    pthread_attr_init(&attr);//初始化线程属性
    pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
    pthread_create(&pthid,&attr,thread_func,NULL);
    long thread_ret;
    int ret=pthread_join(pthid,(void**)&thread_ret);
    THREAD_ERROR_CHECK(ret,"pthread_join")
    printf("child return=%ld\n",thread_ret);
    return 0;
}